//
//  LYZLoginRegisterViewController.m
//  01-百思不得姐
//
//  Created by 李昱铮 on 16/9/1.
//  Copyright © 2016年 LYZ. All rights reserved.
//

#import "LYZLoginRegisterViewController.h"

@interface LYZLoginRegisterViewController ()
/** 登录框距离控制器View左边的间距 */
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *loginViewLeftMargin;
@end

@implementation LYZLoginRegisterViewController

- (IBAction)back {
    [self dismissViewControllerAnimated:YES completion:nil];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)showLoginOrRegister:(UIButton *)button {
    //推出键盘
    [self.view endEditing:YES];
    
    if (self.loginViewLeftMargin.constant == 0)
    {//显示注册界面
        self.loginViewLeftMargin.constant = - self.view.width;
        button.selected = YES;
        //[button setTitle:@"已有账号?" forState:UIControlStateNormal];
    }
    else
    {//显示登录界面
        self.loginViewLeftMargin.constant = 0;
        button.selected = NO;
        //[button setTitle:@"注册账号" forState:UIControlStateNormal];
    }
    
    [UIView animateWithDuration:0.25 animations:^{
        [self.view layoutIfNeeded];
    }];
}

/**
 *  让当前控制器对应的状态栏为白色
 */
- (UIStatusBarStyle)preferredStatusBarStyle
{
    return UIStatusBarStyleLightContent;
}

@end
